package com.xinlong.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xinlong.dao.TravellerMapper;
import com.xinlong.entity.Traveller;
import com.xinlong.service.TravellerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TravellerServiceImpl implements TravellerService {

    @Autowired
    private TravellerMapper TravellerMapper;

    public List<Traveller> show(int page, int rows, String phoneNum) {
        PageHelper.startPage(page,rows);
        List<Traveller> list = TravellerMapper.selByCondition(phoneNum);
        PageInfo<Traveller> info = new PageInfo<Traveller>(list);
        return info.getList();
    }

    public List<Traveller> selByOrderId(String orderId) {
        return TravellerMapper.findByordersid(orderId);
    }


}
